package com.jfm.jfmm.collector.enums;

import lombok.Getter;

/**
 * @author DYang
 * @since 2024-10-13 21:54
 *
 * 采集等级
 */
@Getter
public enum CollectLevel {

    HIGH(1,"高"),
    MIDDLE(2,"中"),
    LOW(3,"低");

    private final int level;
    private final String msg;

    CollectLevel(int level,String msg) {
        this.level = level;
        this.msg = msg;
    }

    /**
     * 根据等级获取枚举
     * @param level
     * @return
     */
    public static CollectLevel getByLevel(int level) {
        for (CollectLevel collectLevel : CollectLevel.values()) {
            if (collectLevel.level == level) {
                return collectLevel;
            }
        }
        return null;
    }

}
